import RenderUtils from "../RenderUtils";
import {RenderTypeItem} from "../ConfigType";

const datePicker: RenderTypeItem = {
  name: 'datePicker',
  components: {
    // @ts-ignore
    ElDatePickerExtend: () => import('../components/ElDatePickerExtend/picker/date-picker.js')
  },
  /**
   *
   * @param createElement
   * @param vm
   * @param formItem
   * @return {VNode[]}
   */
  render(createElement, vm, formItem) {
    const config = RenderUtils.getConfig(vm, formItem, {
      props: {
        placeholder: '请选择' + formItem.label,
      },
    }, this)
    return [
      createElement('ElDatePickerExtend', config)
    ]
  }
}

export default datePicker
